<?php
/**
 * +----------------------------------------------------------------------
 * | summer framework
 * +----------------------------------------------------------------------
 * | Copyright (c) 2020 https://github.com/suframe/think-admin All rights reserved.
 * +----------------------------------------------------------------------
 * | Author: summer <806115620@qq.com>  2020/3/26 10:40
 * +----------------------------------------------------------------------
 */
declare (strict_types = 1);

namespace app\mall\logic;

use app\mall\model\MallStore;

/**
 * 门店service
 * Class StoreService
 * @package app\mall\service
 */
class StoreLogic extends Base
{

    /**
     * 创建门店
     * @param array $info
     * @return int
     */
    public function create(array $info): int
    {
        //检测去重
        //增加到数据库，初始化账户等信息
    }

    /**
     * 修改信息
     * @param MallStore $mallStore
     * @param array $info
     * @return bool
     */
    public function edit(MallStore $mallStore, array $info): bool
    {
        //过滤修改项目
    }

    /**
     * 商家检索
     * @param $cond
     * @return array
     */
    public function search($cond): array
    {
        return [];
    }

    /**
     * 根据id条件检索
     * @param int $id
     * @param array $cond
     * @return MallStore
     */
    public function findById(int $id, array $cond = []): MallStore
    {
    }

    /**
     * 根据条件查找
     * @param $cond
     * @return MallStore
     */
    public function find($cond): MallStore
    {

    }

    /**
     * 门店暂停营业
     * @param MallStore $mallStore
     * @return bool
     */
    public function down(MallStore $mallStore): bool
    {

    }

    /**
     * 门店开始营业
     * @param MallStore $mallStore
     * @return bool
     */
    public function up(MallStore $mallStore): bool
    {

    }

}